﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace DoubleClick.Logging
{
    public class EventLogger : ILogger
    {
        private string logFilename;

        public EventLogger(string filename)
        {
            logFilename = filename;
        }

        #region ILogger Membri di

        public void Write(EventLogType t, string message)
        {
            using (StreamWriter writer = File.AppendText(logFilename))
            {
                writer.WriteLine("{0}: {1} - {2}", DateTime.Now.ToString(), t.ToString(), message);
            }
        }

        #endregion
    }

    public interface ILogger
    {
        void Write(EventLogType e, string m);
    }
}
